// 1引入
const  path=require("path")

// path.join(str,str,str,,,,)**************** 拼接路径

console.log("a\\"+"b\\"+"c");// a\b\c
console.log(   path.join("a","b","c")     );// a\b\c

console.log(   path.join("a\\b\\c","d/e/f","g////h/////i")      );
//  a\b\c\d\e\f\g\h\i  允许出现不规则的写法


console.log(  path.join("a/b/c/d/e/f/g","../../h/i/j/k")    );
// a\b\c\d\e\h\i\g\k
/* 
a
    b
        c
            d
                e
                    f
                        g
                    h
                        i
                            j
                                k
*/


const fs=require("fs")


// __dirname  C:\Users\IBM\Desktop\软件学院0906\day08nodejs\内置模块

// path("C:\\Users\\IBM\\Desktop\\软件学院0906\\day08nodejs\\内置模块","../昨天作业/trim.js")


let filepath=path.join(__dirname,"../昨天作业/trim.js")

let res=fs.readFileSync( filepath,"utf-8")
console.log(res);

// 经常用到
// let filepath=path.join(__dirname,str1,str2)
